package src;

import javax.swing.*;
import java.awt.*;

public class FirstPage extends JFrame{
    /**
     *
     */
    private static final long serialVersionUID = 1L;
    JButton confirm;//确认键
    JLabel labelOfLineNumber;//行数的标签
    JLabel labelOFColumnNumber;//列数的标签
    JLabel welcome;//欢迎标签
    JLabel calculator;//计算器标签
    JTextField lineNumber;//行数
    JTextField columnNumber;//列数

    FirstPage(boolean isVisible){
        this.setTitle("单纯形法计算器");
        welcome = new JLabel("欢迎来到勾勾牌");
        welcome.setBounds(70, 30, 300, 100);
        Font typeface = new Font("宋体", Font.BOLD, 20);
        welcome.setFont(typeface);
        calculator = new JLabel("单纯形法计算器", JLabel.LEFT);
        calculator.setFont(typeface);
        calculator.setBounds(70, 60, 200, 100);
        confirm = new JButton("确认");
        confirm.setBounds(100, 280, 100, 40);
        labelOfLineNumber = new JLabel("行数");
        labelOfLineNumber.setBounds(50, 150, 50, 20);
        labelOFColumnNumber = new JLabel("列数");
        labelOFColumnNumber.setBounds(50, 200, 50, 20);
        lineNumber = new JTextField();
        lineNumber.setBounds(100, 150, 100, 20);
        columnNumber = new JTextField();
        columnNumber.setBounds(100, 200, 100, 20);


        Container contentPane = this.getContentPane();
        contentPane.setLayout(null);
        contentPane.add(welcome);
        contentPane.add(calculator);
        contentPane.add(confirm);
        contentPane.add(labelOfLineNumber);
        contentPane.add(labelOFColumnNumber);
        contentPane.add(lineNumber);
        contentPane.add(columnNumber);
        this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        this.setResizable(false);
        this.setSize(300,400);
        this.setLocationRelativeTo(null);//居中
        this.setVisible(isVisible);


    }
}